<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="common/include :: header('审核详情')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-bpmnInfo-edit" >

        <div class="form-group">
            <label class="col-sm-3 control-label">用户名称：</label>
            <div class="col-sm-8">
                <input name="name" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">请假原因：</label>
            <div class="col-sm-8">
                <input name="reason"  class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">开始时间：</label>
            <div class="col-sm-8">
                <input type="text" class="time-input form-control" id="startTime" placeholder="开始时间" name="starttime"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label ">结束时间：</label>
            <div class="col-sm-8">
                <input type="text" class="time-input form-control" id="endTime" placeholder="结束时间" name="endtime"/>
            </div>
        </div>

        <div class="form-group" id="directorId">
            <label class="col-sm-3 control-label">审核人(部门经理)：</label>
            <div class="col-sm-8">
                <select name="mgr" class="form-control m-b" >
                    <option th:each="u : ${mgrs}" th:text="${u.userName}" th:value="${u.id}"></option>
                </select>
            </div>
        </div>

        <div class="form-group" id="financeId">
            <label class="col-sm-3 control-label">审核人(HR)：</label>
            <div class="col-sm-8">
                <select name="hr" class="form-control m-b" >
                    <option th:each="u : ${hrs}" th:text="${u.userName}" th:value="${u.id}"></option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">备注信息：</label>
            <div class="col-sm-8">
                <textarea name="info" class="form-control"></textarea>
            </div>
        </div>

    </form>
</div>
<th:block th:include="common/include :: footer" />
<script th:inline="javascript">

    var prefix = ctx + "/business/busLeave";
    var bus_carPackageLimit = [[${@config.getValue('bus_car_package_limit')}]];
    $(function () {
        var limit = parseFloat(bus_carPackageLimit);
        console.log(limit);
        console.log($("#discountPriceId").val());
        if($("#discountPriceId").val() < limit){
            //若是折扣金额没超上限，则不用财务审核
            $("#financeId").remove();
        }
    })

    $("#form-bpmnInfo-edit").validate({
        focusCleanup: true
    });
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/startAudit", $('#form-bpmnInfo-edit').serialize());
        }
    }
</script>
</body>
</html>